home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / qwindows.arc / WINDTST.BAS < prev    next >
Encoding:
BASIC Source File  |  1987-05-06  |  2.3 KB  |  56 lines

  1. 'Program to test the assy language routines in WINDLIB, which makes windows.
  2. 'The attributes are same as QBasic's colors; background 0-7, foreground 0-15.
  3.  
  4. Option base 1:Dim Scr1%(2000),Scr2%(2000)
  5. Print "This is the old screen which will be restored after the window is up."
  6. gosub X1                   'Wait for a key
  7. Where%=Varptr(Scr1%(1)):call Savescrn(Where%)
  8.  
  9. Color 0,7:cls              'Black on white background
  10. Lcol%=20:Rcol%=60          'Rcol =< 80: Rcol >= Lcol + 2: Shadow => Lcol > 2
  11. Urow%=2:Lrow%=20           'Lrow =< 25: Lrow >= Urow: Shadow => Lrow =<24
  12. Attr%=&h34                 '= 16*Background color + Foreground color
  13. Frame%=1                   '0 => Single line, 1 => Double line
  14.              '2 => double horiz, single vert, 3 => single horiz. double vert
  15. Explode%=1                 '0 => Full size, >0 => Explode
  16. Shadow%=1                  '0 => No shadow, >0 => Shadow
  17. x1%=Lcol% + 256*Rcol%      'Form integer variables to pass
  18. x2%=Urow% + 256*Lrow%
  19. x3%=Attr% + 256*Frame%
  20. x4%=Explode% + 256*Shadow%
  21. call Makewind(x1%,x2%,x3%,x4%) 'Draw window
  22. Color 0,3:locate 4,31:print"W E L C O M E   T O"
  23. cOLOR 4,3:LOCATE 6,25:PRINT"B O B   M O N T G O M E R Y ' S"
  24. Color 0,3:Locate 8,39:print"A T"
  25. locate 10,31:print"using D O S   3 . 2"
  26.  
  27. gosub X1                   'Wait for a key
  28. Where%=Varptr(Scr2%(1)):call Savescrn(Where%)
  29.  
  30. Lcol%=10:Rcol%=50          'Rcol =< 80: Rcol >= Lcol + 2: Shadow => Lcol > 2
  31. Urow%=2:Lrow%=12           'Lrow =< 25: Lrow >= Urow: Shadow => Lrow =<24
  32. Attr%=&h1A                 '= 16*Background color + Foreground color
  33. Frame%=0                   '0 => Single line, 1 => Double line
  34.              '2 => double horiz, single vert, 3 => single horiz. double vert
  35. Explode%=0                 '0 => Full size, >0 => Explode
  36. Shadow%=0                  '0 => No shadow, >0 => Shadow
  37. x1%=Lcol% + 256*Rcol%      'Form integer variables to pass
  38. x2%=Urow% + 256*Lrow%
  39. x3%=Attr% + 256*Frame%
  40. x4%=Explode% + 256*Shadow%
  41. call Makewind(x1%,x2%,x3%,x4%) 'Draw window
  42. call  Maksnd
  43. cOLOR 7,1:Locate 7,26:Print "H E L L O"
  44.  
  45. gosub X1                   'Wait for a key
  46. call Maksnd
  47. Where%=Varptr(Scr2%(1)):call Getscrn(Where%)
  48.  
  49. gosub X1                   'Wait for a key
  50. call Maksnd
  51. Where%=Varptr(Scr1%(1)):call Getscrn(Where%)
  52. End
  53.  
  54. X1: A$=Inkey$:If A$="" then goto X1
  55.     Return
  56.